#
PLATFORM = $(shell uname -i)
BINDIR = $(HOME)/bin

ifeq ($(PLATFORM),x86_64)
        LIBDIR = $(HOME)/lib64
else 
        LIBDIR = $(HOME)/lib
endif

ifeq ($(FC),ifort) # intel fortran
	OPTS =  -static-intel
        F77  = $(FC) $(OPTS) 
        F95  = $(FC) $(OPTS) 
        F90  = $(F95)
	CMP = _i
else 
	OPTS =  -O3 -fbounds-check -ffixed-line-length-none	
        F77  = gfortran $(OPTS)
	F95 =  $(F77)
        F90  = $(F90)
	CMP = _g
endif

BINDIR = $(HOME)/bin/
#BINDIR = .

.SUFFIXES: .f

.f.o:  
	$(F77) -c $<

all2: 	wp_xi_ccf3_pltbl2$(CMP) wp_xi_acf3_tbl2$(CMP)	


clean:
	rm -f *.o


wp_xi_ccf3_pltbl2$(CMP): wp_xi_cf_hod3.o powspec3.o ccf_pl_tbl2.o num_utils.o
	$(F77) -o $(BINDIR)/$@ wp_xi_cf_hod3.o powspec3.o ccf_pl_tbl2.o num_utils.o

wp_xi_acf3_tbl2$(CMP): wp_xi_cf_hod3.o powspec3.o acf_tbl2.o num_utils.o
	$(F77) -o $(BINDIR)/$@ wp_xi_cf_hod3.o powspec3.o acf_tbl2.o num_utils.o
